package com.ztsoft.user.pojo.entity.dynamic;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ztsoft.user.pojo.entity.user.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_column_description_user")
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class ColumnDescriptionUser extends BaseEntity {

    @TableId(type = IdType.ASSIGN_UUID)
    private String id;// '主键'
    /**
     * 原id
     */
    private String rawId;
    /**
     * 字段key
     */
    private String field;
    /**
     * 字查询段key
     */
    private String selectField;
    /**
     * 表头名
     */
    private String title;
    /**
     * 字段类型
     */
    private String type;
    /**
     * 宽度width
     */
    private Integer width;

    //对齐方式
    private String align;

    //固定方式
    private String fixed;
    /**
     * 是否显示
     */
    private Boolean visible;

    //排序
    private Boolean sortable;
    //顺序
    private Integer sequence;
    //表头超出隐藏
    private Boolean showHeaderOverflow;

    //内容超出隐藏
    private Boolean showOverflow;
    //插槽名
    private String slots;
    //是否拖动列宽
    private Boolean resizable;
    //默认值
    private String defaultValue;
    //描述
    private String fieldDescribe;
    //表格编码
    private String tableCode;
    //用户id
    private String userId;
    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 修改时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date modifyTime;
    /**
     * 创建id
     */
    private String createId;
    /**
     * 修改id
     */
    private String modifyId;
    /**
     * 是否删除
     */
    private Integer isDelete;
    //可搜索
    private Boolean searchable;

    @TableField(exist = false)
    private List<Map<String, String>> correspondingField = new ArrayList<>();

    @TableField(exist = false)
    private List<String> rawIds;

    @TableField(exist = false)
    // private Boolean exhibition = true;
    private Boolean exhibition;

}
